/**
 * ================================
 *              ReadMe
 * 1. 默认的http api后续您应该根据页面进行区分
 * 2. 本文件即作为一个示例
 * 3. 首先我们需要将axios导入
 * 4. 编写完逻辑后将api导出到../api.js中进行统一管理
 *
 * ================================
 */
import axios from '@/request/axios'

/**
 * post 方法
 * @param {*} params
 * @param config
 * @returns
 */

export const getUserId = async (config = {}) => {
  const { data: res } = await axios.get('/auth/getUserId', {
    params:config.params,
    loading:  config.loading || false,
    showMessage: config.loading || false
  })
  return res
}
export const getSalaryBrowse = async (config = {}) => {
  const { data: res } = await axios.get(`/auth/salaryBrowse?start_time=${config.start_time}&end_time=${config.end_time}`, {
    // params:config.params,
    loading:  config.loading || false,
    showMessage: config.loading || false
  })
  return res
}
export const addLibrary = async (config = {}) => {
  const { data: res } = await axios.post(`/auth/addLibrary?name=${config.name}&styleNumber=${config.styleNumber}&image=${config.image}`, {
    loading:  config.loading || false,
    showMessage: config.loading || false
  })
  return res
}
export const deleteLibrary = async (config = {}) => {
  const { data: res } = await axios.delete(`/auth/deleteLibrary?id=${config.id}`, {
    loading:  config.loading || false,
    showMessage: config.loading || false
  })
  return res
}



export const settleAccounts = async (data = {}) => {
  const { data: res } = await axios.post('/auth/settleAccounts', data)
  return res
}
